package com.wjb.springcloud.controller;

import com.wjb.springcloud.pojo.FeignClient;
import com.wjb.springcloud.pojo.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FeignController {

    @Autowired
    private FeignClient feignClient;

    @RequestMapping(value = "/feign",method = RequestMethod.GET)
    public Student findbyId(@RequestParam(value = "id") Integer id){
        return feignClient.findById(id);
    }
    @RequestMapping(value = "/feign2",method = RequestMethod.GET)
    public String hi(@RequestParam(value = "id") Integer id){
        return "你好"+id;
    }
}
